<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<table cellspacing="0" border="0" width="995">
	<tr>
		<td width="995" class="title_manager_product">Quản lý tin tức</td>
	</tr>
	<tr>
		<td>
			<table border="0" cellpadding="0" cellspacing="0" width="995">
				<tr>
					<td align="center">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><a href="index.php?admin=newAdmin&do=formaddnews"><img src="images/CreateNews.gif" width="48" height="47" border="0" /></a></td>
							</tr>
							<tr>
								<td align="center" class="title_new_add"><a href="index.php?admin=newAdmin&do=formaddnews">Thêm tin tức</a></td>
							</tr>
						</table>
						
					</td>
					
					<td align="center">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center"><a href="index.php?admin=newAdmin&do=formaddnewtype"><img src="images/CreateCategory.gif" width="51" height="48" border="0" /></a></td>
							</tr>
							<tr>
								<td align="center" class="title_new_add"><a href="index.php?admin=newAdmin&do=formaddnewtype">Thêm kiểu tin tức</a></td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>	
	</tr>
</table>

<table class="reference" cellspacing="0" border="0" width="995">
	<tr>
		<td width="200" valign="top">					
			<?php
				include("menuleftnew.php");
			?>
		</td>	
		
		<td width="795" valign="top">
			<table cellspacing="0" border="0" width="795">
				<tr>
					
					<td width="795" class="title_manager_cate">Danh sách tin</td>
				
				</tr>
			</table>
			
			<table class="reference" cellspacing="0" border="1" width="795">
		    	<tr>
		        	<th><b>ID</b></th>
		            <th><b>Ảnh</b></th>
		            <th><b>Tiêu đề</b></th>
		            <th><b>Mô tả tin</b></th>
		           
		            <th><b>Trạng thái</b></th>
		            <th><b>Chức năng</b></th>
		        </tr>
		        <?php
		        	$query = "SELECT * FROM newdetails ORDER BY id DESC";
		            $result = mysql_query($query) or die(mysql_error());
					$img="../user/";
		            while($rows = mysql_fetch_array($result)){?>
		            <tr>
		            	<td><?php echo $rows['id'];?></td>
		                <td><img src="<?php echo $img.$rows['newImage']?>" width="60" height="60" border="0" /></td>
		                <td><?php echo $rows['newName'];?></td>
		                <td><?php echo $rows['newDetail']?></td>
		               
		                <td><?php
							if($rows['state']=='on'){
								echo "Hiện";
							}else{
								echo "Ẩn";
							}
						?></td>
		                <td align="center">
		                    <a href="index.php?admin=newAdmin&do=formeditnews&id=<?php echo $rows[0];?>" title="Sửa"><img src="images/edit.gif" width="17" height="17" border="0" /></a>
		                    <a href="index.php?admin=newAdmin&do=deletenews&id=<?php echo $rows[0];?>"  onclick="return confirm('Bạn có muốn xoá tin không?');" title="Xóa"><img src="images/delete.gif" width="17" height="17" border="0" /></a>                        
		                </td> 
		            </tr>
		        <?php
		        }
				?>    
		    </table>
		</td>
	</tr>	
</table>
</body>
</html>